package at.jku.pervasive.filter;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;

import junit.framework.TestCase;
import at.jku.pervasive.Position;

/**
 * Abstract test case for filter testing.
 * @author clemens
 */
public abstract class AbstractFilterTestCase extends TestCase
{

	protected void testFilter(Position expected, LinkedList<Position> positions)
	{
		Position first = positions.getFirst();
		assertEquals(expected.getX(), first.getX());
		assertEquals(expected.getY(), first.getY());
		assertEquals(expected.getZ(), first.getZ());
		assertEquals(expected.getId(), first.getId());
		assertEquals(expected.getDate().getTime(), first.getDate().getTime());
	}

	protected LinkedList<Position> getAsLinkedList(Position... positions)
	{
		List<Position> list = Arrays.asList(positions);
		return new LinkedList<Position>(list);
	}

}
